<?php

namespace addons\qingdongams\validate;

use think\Validate;

class Customer extends Validate {
	/**
	 * 验证规则
	 */
	protected $rule = [
		'create_staff_id' => 'require|number',
		'owner_staff_id'  => 'require|number',
		'name'            => 'require|max:50',
		'subname'         => 'max:50',
		'level'           => 'number|between:0,5',
		'contract_status' => 'number|between:0,1',
		'industry'        => 'max:50',
		'source'          => 'max:50',
		'follow'          => 'max:50',
		'address'         => 'max:100',
		'address_detail'  => 'max:100',
		'parent_id'       => 'number',
		'remark'          => 'max:250',
		'location'        => 'max:128',
		'lng'             => 'max:32',
		'lat'             => 'max:32',
		'number'          => 'max:32',
		't_yield'         => 'max:32',
		'p_yield'         => 'max:32',
		'scale'           => 'max:32',
	];
	/**
	 * 提示消息
	 */
	protected $message = [];
	/**
	 * 字段描述
	 */
	protected $field = [
		'create_staff_id' => '员工',
		'owner_staff_id'  => '员工',
		'name'            => '客户名称',
		'subname'         => '助记名称',
		'level'           => '客户星级',
		'industry'        => '所属行业',
		'follow'          => '客户状态',
		'source'          => '客户来源',
		'address'         => '所在地区',
		'address_detail'  => '详细地址',
		'parent_id'       => '上级公司',
		'remark'          => '备注',
		'contract_status'          => '成交状态',

	];
	/**
	 * 验证场景
	 */
	protected $scene = [
		'create' => [
			'name',
			'subname',
			'level',
			'industry',
			'source',
			'follow',
			'address',
			'address_detail',
			'parent_id',
			'remark',
			'location',
			'lng',
			'lat',
			'number',
			't_yield',
			'p_yield',
			'scale',
		],
		'edit'   => [
			'name',
			'subname',
			'level',
			'industry',
			'source',
			'follow',
			'address',
			'address_detail',
			'remark',
			'location',
			'lng',
			'lat',
			'number',
			't_yield',
			'p_yield',
			'scale',
		],
	];
}
